function formToJsonStr(data) {
    data = decodeURIComponent(data)  // 解码
    data = data.replace(/&/g, "\",\"");
    data = data.replace(/=/g, "\":\"");
    data = "{\"" + data + "\"}";
    return data;
}

function formToJson(data) {
    return JSON.parse(formToJsonStr(data));
}

function jsonToUrlParams(data) {
    var p = "";
    for (var k in data) {
        if (data[k]) {
            p = p + (p == "" ? "?" : "&") + k + "=" + data[k];
        }
    }
    return p;
}

function formatPrice(d) {
    var nums = (Number(d) || 0).toString().split('.');
    return nums[0] + '.' + (nums[1] || '0').padEnd(2, "0");
}